package edu.kjxy.worker0312;

import java.util.Scanner;

public class worker01 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int sum = 0;
		int max = Integer.MIN_VALUE;
		int min = Integer.MAX_VALUE;
		int count = 0;
		System.out.println("请输入非零的数，输入0退出：");
		while(true)
		{
			int num = in.nextInt();
			if(num == 0)
				break;
			if(max < num) max = num;
			if(min > num) min = num;
			sum += num;
			count++;
		}
		int average = sum / count;
		if(count == 0)
			System.out.println("您没有输入任何非零数!");
		else {
			System.out.println("平均值：" + average);
			System.out.println("最大值：" + max);
			System.out.println("最小值：" + min);
		}
		
		in.close();
	}

}
